package com.kma.summer2012.client.events.operator;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.kma.summer2012.shared.model.UICrumbsRequest;

public class OperatorRequestEvent extends GwtEvent<OperatorRequestEvent.OperatorRequestEventHandler> {
    public static GwtEvent.Type<OperatorRequestEventHandler> TYPE = new GwtEvent.Type<OperatorRequestEventHandler>();

    private UICrumbsRequest request;

    public OperatorRequestEvent(UICrumbsRequest req) {
        request = req;
    }

    public interface OperatorRequestEventHandler extends EventHandler {
        void onOperatorRequestEvent(OperatorRequestEvent event, UICrumbsRequest request);
    }

    @Override
    public Type<OperatorRequestEventHandler> getAssociatedType() {
        return TYPE;
    }


    public static Type<OperatorRequestEventHandler> getType() {
        return TYPE;
    }

    protected void dispatch(OperatorRequestEventHandler handler) {
        handler.onOperatorRequestEvent(this, request);
    }


}

